// Drummer
// by Andrea Bianchi
// andreabianchi.alsoplantsfly.com

/*
 Copyright (C) 2009, Andrea Bianchi
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 as published by the Free Software Foundation; either version 2
 of the License, or (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/


#ifndef __CIRCLE__H__
#define __CIRCLE__H__

#include "global.h"
#include "doubleColor.h"

#define DEFAULT_VELOCITY 100
#define MIN_VELOCITY 20
#define MAX_VELOCITY 120

namespace DS
{

	class Circle 
	{
	public:
		Circle();
		Circle (Coord pos, u16 radius, DoubleColor color, Color stroke=NONE);
		~Circle(){}
		Circle& operator=(const Circle& other);

 		void draw (ScreenId screen);
		BoundingBox getBB() const;
		bool hitTest (Coord c) const;
 
		inline void setRadius (u16 r){ rad_=r;}
		inline u16 getRadius () const { return rad_;}
		
		void setColor (DoubleColor c);
		inline void setStroke (Color c){ stroke_= c; }
		
		inline void setPosition (const Coord& p){ pos_=p; }
		inline Coord getPosition () const { return pos_; }

		inline u8 getVelocity (){ return velocity_;}
		void setVelocity(u8 velocity);
		inline void incrementVelocity(){ setVelocity(velocity_+10);}
		inline void decremnetVelocity(){ setVelocity(velocity_-10);}
		inline void resetVelocity(){ setVelocity(DEFAULT_VELOCITY);}

		inline bool operator<(const Circle& o)
		{	
			return rad_<o.rad_;
		}

		inline bool operator==(const Circle& o)
		{	
			return rad_==o.rad_;
		}

	private:
		Coord pos_;
		u16 rad_, stroke_;
		u8 velocity_;
		Color col_;
		DoubleColor dcol_;
	};
}

#endif __CIRCLE__H__